<%--
  @desc: 办事指南
--%>
<%@ page contentType="text/html;charset=utf-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
 <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
 <meta name="format-detection" content="telephone=no">
 <meta name="apple-mobile-web-app-capable" content="yes">
 <meta name="apple-mobile-web-app-status-bar-style" content="black">
 <link rel="stylesheet" type="text/css" href="<c:url value='/resource/weixin/css/global.css'/>">
 <script src="<c:url value='/resource/weixin/js/jquery-1.8.3.min.js'/>"></script>
 <script src="<c:url value='/resource/weixin/js/FormValid.js'/>"></script>
 <script src="<c:url value='/resource/weixin/js/main.js'/>"></script>
 <script src="<c:url value='/resource/js/jquery.form.min.js'/>"></script>
 <style>
 li.road_current_li{ color:#fff;}
 </style>
<title>办事指南</title>
</head>

<body>
<div class="row">
  	<ul class="road clearfix">
  		<li class="road_current_li" onclick="javascript:showPage(1,'',1);" class="road_current_li">户政</li>
  		<a href="<c:url value='/weixin/bmsrv/bszn2'/>" target="_blank"><li>交警</li></a>
    	<a href="<c:url value='/weixin/bmsrv/bszn3'/>"><li>出入境</li></a>        
        <a href="<c:url value='/weixin/bmsrv/bszn4'/>"><li>其他</li></a>    
    </ul>
</div>
<!--wrap-page-->
<div class="wrap-page"  style="top:100px;">
  <!--链接网页-->
  <div class="row">
  	<ul class="tab_ul">
            <!-- 个人查询-->
    		<li>
                <ul class="input_ul">
                    <li style="border-bottom: 1px solid #ddd; position:relative;">
                    	<input type="text" id="geren_search">
                    	<input type="button" onclick="geren_search()" value="查 询" class="notice_input" style="width:30%; height:38px;">
                    </li>
                </ul>
				<ul class="bszn_ul bszn_geren"></ul>
            </li>
        </ul>
  </div>
  
</div>
<script type="text/javascript">
var pageSize=10;

/**
	 @param pageSize	每页数量
	 @param pageIndex	页	
	 @param subject	" "全部,"1"户政,"2"交警,"3"出入境，"4"其他
	 @param keyword	关键词
**/
function showPage(pageIndex,keyword,subject){
	$(".bszn_geren li,.bszn_qiye li").remove();
	$.ajax({
	    url: "<c:url value='/weixin/query/bmsrv/case/list'/>",
	    timeout:8000,
	    data:{police:subject,keyword:keyword},
	    type: "get",
	    dataType: 'json', 
	    success: function (data) {
	    	var html = "";
	    	if(data.data.length>0){	
				$.each(data.data,function(i,v){
					html+="<li>";
					html+="<a href=\"<c:url value='/weixin/query/bmsrv/case/detail'/>?matterId="+v.id+"\">";
					html+="<p class=\"bszn_p1\">"+v.matter+"</p>";
					html+="<p class=\"bszn_p2\">受理单位："+v.area+"</p>";
					html+="</a>";
					html+="</li>";
				});
	    	}else{
	    		html+="<li><a style='font-size:15px;color:#999' href=\"javascript:;\">暂无数据</a></li>";
	    	}
	    	resultHandle(subject,html);
	    },
        beforeSend: function () {
			
        },
	    complete : function(XMLHttpRequest,status){
	    　　　 if(status=='timeout'){
		    	html="<li><a href=\"javascript:;\">访问超时,请稍后再试</a></li>";
		    	resultHandle(subject,html);
	    　　　 }
	    　}
	});
}

function resultHandle(subject,html){
	$(".bszn_geren").append(html);
}

function geren_search(){
	showPage(1,""+encode($("#geren_search").val())+"",1);
}

function encode(keyword){
	return encodeURIComponent(keyword);
}

$(function(){
	showPage(1,"",1);
});
</script>
</body>
</html>
